/**
 * Copyright (c) 2013 Mark Tielemans
 * All rights reserved. This program and the accompanying materials
 * are made available under the terms of the Eclipse Public License v1.0
 * which accompanies this distribution, and is available at
 * http://www.eclipse.org/legal/epl-v10.html
 *
 * DISCLAIMER
 * This software is provided "as is" and any expressed or implied warranties, including, but not limited to, the implied warranties of 
 * merchantability and fitness for a particular purpose are disclaimed. In no event shall the regents or contributors be liable for any 
 * direct, indirect, incidental, special, exemplary, or consequential damages (including, but not limited to, procurement of substitute 
 * goods or services; loss of use, data, or profits; or business interruption) however caused and on any theory of liability, whether in 
 * contract, strict liability, or tort (including negligence or otherwise) arising in any way out of the use of this software, even if 
 * advised of the possibility of such damage.
 */
package nl.marktielemans.easydb.model;

import nl.marktielemans.easydb.DatabaseVendor;
import nl.marktielemans.easydb.generator.QueryGenerator;

/**
 * Represents a type of Index that can be applied to columns. The sqlText property is used directly 
 * in queries generated by the {@link QueryGenerator}.
 * <br /><br />
 * Indexes of type Primary key will be applied as one index over several columns. Other types of indexes \
 * will be applied to columns individually. It is currently not possible to make a combination of field 
 * values unique.
 * <br /><br />
 * This class can be expanded for use with not-yet supported {@link DatabaseVendor DatabaseVendors}. 
 *  
 * @author Mark Tielemans
 * @since 1.0
 * @version 1.0
 */
public class IndexType {

	public static final IndexType SQL_PK = new IndexType("PRIMARY KEY");
	public static final IndexType SQL_UNIQUE = new IndexType("UNIQUE KEY");
	
	protected String sqlText;
	
	public IndexType(String sqlText) {
		this.sqlText = sqlText;
	}

	public String getSqlText() {
		return sqlText;
	}
	
	@Override
	public String toString() {
		return sqlText;
	}
}
